package HuaweiOD;

import java.util.Arrays;
import java.util.Scanner;
import java.util.StringJoiner;

public class 按身高和体重排队 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();

        int[] heights = new int[n];
        int[] weights = new int[n];
        for (int i = 0; i < n; i++) {
            heights[i] = in.nextInt();
        }
        for (int i = 0; i < n; i++) {
            weights[i] = in.nextInt();
        }

        int[][] students = new int[n][3];
        for (int i = 0; i < n; i++) {
            students[i] = new int[]{heights[i], weights[i], i + 1};
        }
        solve(students);
    }
    
    public static void solve(int[][] students){
        Arrays.sort(students, (a, b) -> a[0] != b[0] ? a[0] - b[0] : a[1] != b[1] ? a[1] - b[1] : a[2] - b[2]);
        StringJoiner ans = new StringJoiner(" ");
        for (int[] student : students) {
            ans.add(student[2] + "");
        }
        System.out.println(ans);
    }
}
